﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wucProductCategoriesList.ascx.cs" Inherits="Modules_WebsiteBackEnd_wucProductCategoriesList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:UpdatePanel ID="UpdatePanelList" runat="server">
    <ContentTemplate>   
        <table align="center" border="0" cellpadding="0" cellspacing="0" width="790px" class="TableGrayBorder">
            <tbody>
                <tr height="30px">
                    <td align="right">
                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#f0f2f4">
                            <tbody>
                                <tr height="30px">
                                    <td width="150px">&nbsp;</td>
                                    <td align="right" valign="middle">
                                        Ngôn ngữ &nbsp;
                                    </td>
                                    <td align="right" valign="middle" width="255px">
                                        <telerik:RadComboBox DataTextField="languageName" ID="rcboLanguageCode" runat="server" 
                                            ShowToggleImage="True" Skin="Vista" DataValueField="LanguageCode" 
                                            Width="250px" AutoPostBack="True" OnSelectedIndexChanged="rcboLanguageCode_SelectedIndexChanged" HighlightTemplatedItems="True">
                                            <HeaderTemplate>
                                                <table cellspacing="0" cellpadding="0" width=240px>
                                                    <tr>
                                                        <td width="70px">
                                                            Code
                                                        </td>
                                                        <td width="170px">
                                                            Language
                                                        </td>                                                        
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <table cellspacing="0" cellpadding="0" width=240px>
                                                <tr>
                                                    <td width=70px>                                                        
                                                        <%# DataBinder.Eval(Container.DataItem, "LanguageCode")%>                                                        
                                                    </td>
                                                    <td width=170px>                                                        
                                                        <%# DataBinder.Eval(Container.DataItem, "languageName")%>                                                        
                                                    </td>                                                    
                                                </tr>
                                            </table>
                                        </ItemTemplate>                             
                                            <CollapseAnimation Duration="200" Type="OutQuint" />
                                        </telerik:RadComboBox></td>
                                    <td width=2px>&nbsp;</td>
                                    <td align="right" valign="middle">
                                        Thư mục cha &nbsp;
                                    </td>
                                    <td align="right" valign="middle" width="255px">
                                        <telerik:RadComboBox ID="rcboParentCategory" runat="server" ShowToggleImage="True" Skin="Vista" 
                                            DataValueField="CategoryID" Width="250px" DataTextField="CategoryName"
                                            AutoPostBack="True" OnSelectedIndexChanged="rcboParentCategory_SelectedIndexChanged" HighlightTemplatedItems="True">
                                            <HeaderTemplate>
                                                <table cellspacing="0" cellpadding="0" width=240px>
                                                    <tr>
                                                        <td width="80px">
                                                            Code
                                                        </td>
                                                        <td width="160px">
                                                            CatName
                                                        </td>                                                                                                                
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <table cellspacing="0" cellpadding="0" width=240px>
                                                <tr>
                                                    <td width=80px>                                                        
                                                        <%# DataBinder.Eval(Container.DataItem, "CategoryCode")%>                                                        
                                                    </td>
                                                    <td width=160px>                                                        
                                                        <%# DataBinder.Eval(Container.DataItem, "CategoryName")%>                                                        
                                                    </td>                                                    
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                            <CollapseAnimation Duration="200" Type="OutQuint" />
                                        </telerik:RadComboBox></td><td width=2px>&nbsp;</td>                                    
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <telerik:RadGrid ID="rgrdGridDataList" runat="server" Skin="WebBlue" Width="790px"
                            PageSize="20" AllowMultiRowSelection="true" AllowPaging="True" ShowGroupPanel="false"
                            AllowAutomaticDeletes=false AllowAutomaticInserts=false AllowAutomaticUpdates=false
                            BorderWidth="0px" GridLines="None" AutoGenerateColumns="false" 
                            OnPageIndexChanged="rgrdGridDataList_PageIndexChanged"
                            AllowSorting="false" OnItemCommand="rgrdGridDataList_ItemCommand">
                            <ClientSettings EnablePostBackOnRowClick="True">
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <PagerStyle Mode="NextPrevAndNumeric" NextPagesToolTip="Trang sau" NextPageToolTip="Trang sau"
                                PagerTextFormat="Lựa chọn trang: {4} &amp;nbsp;Trang {0} / {1}, bản ghi {2} - {3} / {5}."
                                PrevPagesToolTip="Trang trước" PrevPageToolTip="Trang trước" />
                            <MasterTableView DataKeyNames="CategoryID">
                                <RowIndicatorColumn Visible="False">
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn Resizable="False" Visible="False">
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <EditFormSettings>
                                    <PopUpSettings ScrollBars="None" />
                                </EditFormSettings>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="CategoryID" HeaderText="ID" ReadOnly="True"
                                        UniqueName="CategoryID">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="LanguageCode" HeaderText="Ngôn ngữ"
                                        UniqueName="LanguageCode" ReadOnly=true ItemStyle-HorizontalAlign=left>
                                    </telerik:GridBoundColumn>                                    
                                    <telerik:GridBoundColumn DataField="CategoryCode" HeaderText="Mã danh mục" ReadOnly=true
                                        UniqueName="CategoryCode">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="CategoryName" HeaderText="Tên danh mục" UniqueName="CategoryName" ReadOnly=true>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Description" HeaderText="Mô tả" UniqueName="Description" ReadOnly=true>
                                    </telerik:GridBoundColumn>    
                                    <telerik:GridBoundColumn DataField="ParentCategoryID" HeaderText="Danh mục cha" UniqueName="ParentCategoryID" ReadOnly=true>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ParentCategoryName" HeaderText="Tên danh mục cha" UniqueName="ParentCategoryName" ReadOnly=true>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridClientSelectColumn UniqueName="SelectRow" CommandName="RowClick">
                                        <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridClientSelectColumn>
                                    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/icons/editrow.png" UniqueName="ControlEdit" CommandName="RowEdit" Text="Sửa">
                                        <ItemStyle CssClass="MyImageButton"  HorizontalAlign="Center"/>
                                    </telerik:GridButtonColumn>                                    
                                    <telerik:GridButtonColumn ConfirmText="Bạn có muốn xóa bản ghi được lựa chọn?" ConfirmDialogType="RadWindow" 
                                        ConfirmTitle="X&#243;a bản ghi" ButtonType="ImageButton" CommandName="RowDelete" Text="X&#243;a" ImageUrl="~/Images/icons/recyclebin.png"
                                        UniqueName="ControlDelete">
                                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                                    </telerik:GridButtonColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </td>
                </tr>
            </tbody>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
